package cn.edu.scau.cmi.huhaoxian.compositePattern.comsistent;

import java.util.ArrayList;

public abstract class Component {
	protected String name;
	public Component(String name) {
		this.name = name;
	}
	
	public Component(String name,Component parent) {
		this.name = name;
		this.parent = parent;
	}
	
	Component parent = null;
	ArrayList<Component> children = new ArrayList<Component>();
	
	public abstract String doSomething();
	public abstract Component getParent();
	
	public abstract void addChild(Component child);
	public abstract void deleteChild(Component child);
	public abstract ArrayList<Component> getChidren();
	public String getName() {
		return name;
	}
}
